<template>
  <div class="ignore-cart">
    <!-- 导航栏 -->
    <nav-bar class="ignore-nav-bar">
      <div slot="center">购物车（{{ cartLength }}）</div>
    </nav-bar>
    <!-- 商品列表 -->
    <cart-list />
    <!-- 底部操作区 -->
    <cart-bottom-bar />
  </div>
</template>

<script>
import { mapGetters } from "vuex";

import NavBar from "components/common/navbar/NavBar";

import CartList from "./childComps/CartList";
import CartBottomBar from "./childComps/CartBottomBar";

export default {
  name: "Cart",
  components: {
    NavBar,
    CartList,
    CartBottomBar
  },
  computed: {
    /**
     * mapGetters:将Getters转为compute；
     * 两种写法：数组/对象
     */
    ...mapGetters(["cartLength"])
  },
  methods: {}
};
</script>

<style scoped>
.ignore-cart {
  height: calc(100vh - 49px);
}

.ignore-nav-bar {
  line-height: 44px;
  color: #fff;
  background-color: var(--color-tint);
}
</style>
